#ifndef _GOVT_SKILL_HPP_
#define _GOVT_SKILL_HPP_
/*******************************************************************************
 ** Government Sanctioned Espionage RPG                                       **
 ** http://www.government-sanctioned.us/                                      **
 **===========================================================================**
 ** Name: skill.hpp                                                           **
 ** Description: Skills and stuff!                                            **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 ** The contents of this file are subject to the terms of the                 **
 ** Common Development and Distribution License, Version 1.0 only             **
 ** (the "License").  You may not use this file except in compliance          **
 ** with the License.                                                         **
 **                                                                           **
 ** You can find a copy of the license in the LICENSE file within             **
 ** this distribution or at $WIKI/display/GOVT/License-software.              **
 ** Software distributed under the License is distributed on an "AS IS"       **
 ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.           **
 ** See the License for the specific language governing permissions           **
 ** and limitations under the License.                                        **
 **                                                                           **
 ** When distributing Covered Code, include this CDDL header in each          **
 ** file and include the License file at $GAME_DIR/LICENSE.                   **
 ** If applicable, add the following below this header, with the indicated    **
 ** fields enclosed by brackets "[]" replaced with your own identifying       **
 ** information: Portions Copyright [yyyy] [name of copyright owner]          **
 **                                                                           **
 ** Copyright (c) 2009-2012  Barry Gian James <gian@gamingods.net>            **
 ** All rights reserved.                                                      **
 ******************************************************************************/

// Created on March 17, 2010, 12:29 AM
// Modified $Date: 2012-07-16 15:37:05 -0600 (Mon, 16 Jul 2012) $ by $Author: unknown $
// Portions Copyright 2012 Open Design Strategies, LLC.
// All rights reserved.

#define Skill_hpp_ID   "$Id: skill.hpp 68634 2012-07-16 21:37:05Z unknown $"

#include <string>
#include <map>
#include <odb/access.hxx>
#include "action.hpp"
#include "stat.hpp"

//! @class SkillFamily
//! @brief The skill family a skill belongs to
#pragma db object table("skill_family")
class SkillFamily
{
public:
	SkillFamily();

	entity_t	ID() { return idskill_family; }
	std::string 	Name() { return name; }
	std::string		Desc() { return desc; }
	void			Name(const std::string & n) { name = n; }
	void			Desc(const std::string & d) { desc = d; }
private:
	friend class odb::access;
	#pragma db id auto
	entity_t	idskill_family;
	std::string	name;
	std::string	desc;
};
//! @class SkillTag
//! @brief Tags on skills describing alternate requirements for the check
#pragma db object table("skill_tags")
struct SkillTag
{
	#pragma db id auto
	entity_t	idskill_tags;
	std::string	abbr;
	std::string	name;
};

<<<<<<< .mine
#pragma db_object_table("skill_rank_names")
struct SkillRankName
{
	#pragma db id auto
	entity_t	idskill_rank_names;
	std::string	name;
};

=======
//! @class SkillRankNames
//! @brief Categorical skill names for rank numbers
#pragma db object table("skill_rank_names")
struct SkillRankName
{
	entity_t	idskill_rank_name;
	std::string	name;
};

>>>>>>> .r68576
//typedef pair<std::wstring,SkillCheck*>   skill_t;
//! @class Skill
//! @brief The basic/primary skill DB class
#pragma db object table("skill_type")
class Skill {
public:
	Skill() {}
    explicit Skill(const std::string & n) : name(n) { }
    Skill(const Skill& orig);

    entity_t		ID() { return idskill; }
    std::string &	Name() { return name; }
    entity_t &		Attr() { return ability; }
    entity_t &		CounterBonus() { return idcounter_bonus; }
    bool &			Untrained() { return untrained; }
    ActionTime &	Action() { return action; }
    std::string &	Special() { return special; }
    std::string &	Desc() { return desc; }
    SkillFamily &	Family() { return family; }
    
private:
    friend class odb::access;

	#pragma db id auto
    entity_t		idskill;
    std::string    	name;
    entity_t		ability;
    entity_t		idcounter_bonus;
    bool			untrained;
    ActionTime		action;
    std::string		special;	//!< if action = 'special' this is the time
    std::string		desc;
//    entity_t		family;
    SkillFamily		family;
};

//! @class SecondarySkill
//! @brief Represents the secondary skills for characters in the DB
#pragma db object table("skills_secondary")
class SecondarySkill
{
public:
	SecondarySkill() { id = 0; }
	SecondarySkill(std::string & n, std::string & a) : name(n), attr(a) { id = 0; }
	SecondarySkill(const SecondarySkill &);
	SecondarySkill & operator = (const SecondarySkill &);

	std::string	Name() { return name; }
	std::string	& Desc() { return desc; }
	std::string Attr() { return attr; }
	entity_t ID() { return id; }

private:
	friend class odb::access;
	#pragma db id auto
	entity_t	id;
	std::string	name;
	std::string	desc;
	std::string	attr;
};

//! @class CSecondarySkill
//! @brief What each character references for secondary skills
#pragma db value
class CSecondarySkill
{
public:
	CSecondarySkill() { rank = attrBonus = miscBonus = 0; }

	ushort &	Rank() { return rank; }
	ushort &	AttrBonus() { return attrBonus; }
	ushort &	MiscBonus() { return miscBonus; }
	boost::shared_ptr<SecondarySkill> & Skill() { return skill; }

private:
	friend class odb::access;
	ushort		rank;
	ushort		attrBonus;
	ushort		miscBonus;
	boost::shared_ptr<SecondarySkill> skill;
};

#endif	/* _GOVT_SKILL_HPP_ */

